package com.dldata.devtools30.repository.zhibiao;



import com.dldata.devtools30.entity.DevtZbclassInfoEntity;
import com.dldata.devtools30.entity.DevtZbplanParatjEntity;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by ai on 2017/1/11.
 */
@Repository
public interface DevtZbplanParatjEntityDao
        extends com.dldata.devtools30.repository.BaseRepository<DevtZbplanParatjEntity,String>,
        JpaSpecificationExecutor<DevtZbplanParatjEntity> {
    
    @Query("select t from DevtZbplanParatjEntity t where t.paraid = ?1 order by xh ")
    public List<DevtZbplanParatjEntity> getAllByParaid(String paraid);
    
    @Query("select t from DevtZbplanParatjEntity t where t.planid = ?1 and paraid in ( select s.id from DevtZbplanParaEntity s where s.planid=?1 ) order by xh ")
    public List<DevtZbplanParatjEntity> getAllByPlanid(String planid);
    
}
